---
import {getCollection} from 'astro:content';
import MarkdownPostLayout from "../../layouts/MarkdownPostLayout.astro";

export async function getStaticPaths() {
    const blogEntries = await getCollection('posts');
    return blogEntries.map(entry => ({
        params: {slug: entry.slug}, props: {entry}
    }))
}

const {entry} = Astro.props;
const {Content} = await entry.render();
---

<MarkdownPostLayout frontmatter={entry.data}>
    <Content></Content>
</MarkdownPostLayout>